package com.neusoft.mapper;

import com.neusoft.domain.Category;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CategoryMapper {
    List<Category> selectCategoryByCondition(@Param("categoryName") String categoryName,@Param("businessId") Integer businessId);

    @Insert("insert into food_category (categoryName, businessId) values (#{categoryName},#{businessId})")
    void insertCategory(Category category);

    @Update("update food_category set categoryName = #{categoryName} where categoryId = #{categoryId}")
    void updateCategoryById(Category category);

    @Delete("delete from food_category where categoryId=#{categoryId}")
    void deleteById(Integer categoryId);

    @Select("select * from food_category where categoryId = #{categoryId}")
    Category selectById(Integer categoryId);
}
